package com.example.jiaju.ui.main;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import android.os.Bundle;

import com.bumptech.glide.Glide;
import com.example.jiaju.R;
import com.example.jiaju.databinding.ActivityConcreteFurnitureBinding;
import com.example.jiaju.entity.Furniture;
import com.gyf.immersionbar.ImmersionBar;

public class ConcreteFurnitureActivity extends AppCompatActivity {

    private ActivityConcreteFurnitureBinding binding;
    Furniture.PageDTO.ListDTO furnDTO=new Furniture.PageDTO.ListDTO();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding= DataBindingUtil.setContentView(this,R.layout.activity_concrete_furniture);

        //设置黑色状态栏字体
        ImmersionBar.with(this).statusBarDarkFont(true).init();
        //获取数据
        furnDTO= (Furniture.PageDTO.ListDTO) getIntent().getSerializableExtra("furnDTO");

        //填充控件
        Glide.with(this).load(furnDTO.furnImg).into(binding.furnImg);
        binding.furnBrand.setText(furnDTO.furnBrand);
        binding.furnName.setText(furnDTO.furnName);
        binding.furnPrice.setText("￥"+furnDTO.furnPrice.toString());
        binding.furnDetail.setText(furnDTO.furnDetail.toString());

        //回到FurnitureActivity
        binding.returnBtn.setOnClickListener(v->finish());

    }
}